package com.itheima.consumer.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SpringLitenerFanoutMQ {

    @RabbitListener(queues = "fanout.queue")
    public void listenerFanout2Queue1(String msg) throws InterruptedException {
        System.out.println("消费者1 接受了消息:" + msg);
    }

    @RabbitListener(queues = "fanout.queue2")
    public void listenerFanout2Queue2(String msg) throws InterruptedException {

        System.err.println("消费者2 接受了消息......:" + msg);
    }
}
